package testHutools.testStrUtil;

import cn.hutool.core.util.StrUtil;
import org.junit.Test;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

/**
 * @author keyer
 * @Name : hutools.strUtils.WebsocketTest
 * @Description : 描述
 * Created by cyd on 2021-07-13 14:43:18
 */
public class StrSplite {



    @Test
    public void spilt(){
        String strIds="123,456,789";
        String[] arr = StrUtil.split(strIds, ",");
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
        System.out.println("-------------------");
        String strIds02="123";
        String[] arr02 = StrUtil.split(strIds02, ",");
        for (int i = 0; i < arr02.length; i++) {
            System.out.println(arr02[i]);
        }


        System.out.println("-------------------");
        String strIds03="";
        String[] arr03 = StrUtil.split(strIds03, ",");
        for (int i = 0; i < arr03.length; i++) {
            System.out.println(arr03[i]);
        }
    }

    @Test
    public void testEmptyStr(){
        String str="";
        String[] split = StrUtil.split(str, ",");
        System.out.println(split==null);

        assert split != null;
        List<String> list = Arrays.asList(split);
        System.out.println(list.size());
    }

    @Test
    public void test2(){
        HashMap<Object, Object> objectObjectHashMap = new HashMap<>();
        int size = objectObjectHashMap.size();
        System.out.println(size);
    }

}
